<template>
  <el-dialog v-model="dialogVisible" width="500px" max-height="170px">
    <template #header>
      <span>锁定屏幕</span>
    </template>
    <div class="items-center">
      <img src="@/assets/images/avatar.gif" alt="" class="image" />
      <span class="username">Archer</span>
    </div>
    <div class="tip-div">
      <span class="tip-span">锁屏密码为空时默认使用用户登录密码为锁屏密码</span>
    </div>
    <el-form ref="formRef" :model="form" class="form">
      <el-form-item prop="password" label="锁屏密码">
        <el-input
          v-model="form.password"
          type="password"
          placeholder="请输入锁屏密码"
          show-password
          autocomplete="new-password"
        ></el-input>
      </el-form-item>
    </el-form>
    <template #footer>
      <span class="dialog-footer">
        <el-button type="primary" @click="dialogVisible = false">锁定</el-button>
      </span>
    </template>
  </el-dialog>
</template>

<script setup lang="ts">
import { ref } from "vue";
import { ElForm } from "element-plus";

const dialogVisible = ref(false);
const openDialog = () => {
  dialogVisible.value = true;
};

const form = {
  password: ""
};

defineExpose({ openDialog });
</script>
<style scoped lang="scss">
.tip-div {
  margin-top: 5px;
  .tip-span {
    font-size: 12px;
    color: #ff3300;
  }
}
.items-center {
  display: flex;
  text-align: center;
  width: 100%;
  flex-direction: column;
  align-items: center;
}
.image {
  border-radius: 50%;
  width: 80px;
  height: 80px;
}
.username {
  font-size: 14px;
  color: var(--el-header-text-color);
  margin-top: 10px;
}
.form {
  margin-top: 10px;
}
.el-dialog__body {
  padding: 10px 20px;
}
.el-dialog .el-dialog__header {
  padding: 5px 10px;
}
</style>
